/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MostrarSucursales.java
 *
 * Created on 26-nov-2010, 16:29:48
 */

package IGU;

import javax.swing.JFrame;
import logica.FuncionesGUI;

/**
 *
 * @author Cristian
 */
public class MostrarSucursales extends javax.swing.JFrame {
    private JFrame ventanaPadre;

    /** Creates new form MostrarSucursales */
    public MostrarSucursales() {
        initComponents();
        initMyOwnComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTextField2 = new javax.swing.JTextField();
        jTID = new javax.swing.JTextField();
        jTGerente = new javax.swing.JTextField();
        jCEmpleados = new javax.swing.JComboBox();
        jCTelefonos = new javax.swing.JComboBox();
        jCLasSalas = new javax.swing.JComboBox();
        jTDireccion = new javax.swing.JTextField();
        jTCiudad = new javax.swing.JTextField();
        jTPais = new javax.swing.JTextField();
        jHoraE = new javax.swing.JTextField();
        jTMinE = new javax.swing.JTextField();
        jTSegE = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jBAceptar = new javax.swing.JButton();
        jLabel19 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jCSucursal = new javax.swing.JComboBox();
        jLabel20 = new javax.swing.JLabel();
        jTMinS = new javax.swing.JTextField();
        jTSegS = new javax.swing.JTextField();
        jHoraS = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();

        jTextField2.setText("jTextField2");
        jTextField2.setName("jTextField2"); // NOI18N

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jTID.setName("jTID"); // NOI18N
        getContentPane().add(jTID, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 100, 150, -1));

        jTGerente.setName("jTGerente"); // NOI18N
        getContentPane().add(jTGerente, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 150, 150, -1));

        jCEmpleados.setName("jCEmpleados"); // NOI18N
        getContentPane().add(jCEmpleados, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 190, 150, -1));

        jCTelefonos.setName("jCTelefonos"); // NOI18N
        getContentPane().add(jCTelefonos, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 220, 150, -1));

        jCLasSalas.setName("jCLasSalas"); // NOI18N
        getContentPane().add(jCLasSalas, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 250, 150, -1));

        jTDireccion.setName("jTDireccion"); // NOI18N
        getContentPane().add(jTDireccion, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 300, 150, -1));

        jTCiudad.setName("jTCiudad"); // NOI18N
        getContentPane().add(jTCiudad, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 330, 150, -1));

        jTPais.setName("jTPais"); // NOI18N
        getContentPane().add(jTPais, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 360, 150, -1));

        jHoraE.setName("jHoraE"); // NOI18N
        getContentPane().add(jHoraE, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 120, 100, -1));

        jTMinE.setName("jTMinE"); // NOI18N
        getContentPane().add(jTMinE, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 160, 100, -1));

        jTSegE.setName("jTSegE"); // NOI18N
        getContentPane().add(jTSegE, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 200, 100, -1));

        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("ID:");
        jLabel2.setName("jLabel2"); // NOI18N
        getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 100, -1, -1));

        jLabel4.setForeground(new java.awt.Color(255, 255, 255));
        jLabel4.setText("Gerente:");
        jLabel4.setName("jLabel4"); // NOI18N
        getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(39, 153, -1, -1));

        jLabel5.setForeground(new java.awt.Color(255, 255, 255));
        jLabel5.setText("Empleados:");
        jLabel5.setName("jLabel5"); // NOI18N
        getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 190, -1, -1));

        jLabel6.setForeground(new java.awt.Color(255, 255, 255));
        jLabel6.setText("Telefonos:");
        jLabel6.setName("jLabel6"); // NOI18N
        getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 220, -1, -1));

        jLabel7.setForeground(new java.awt.Color(255, 255, 255));
        jLabel7.setText("Las Salas:");
        jLabel7.setName("jLabel7"); // NOI18N
        getContentPane().add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 250, -1, -1));

        jLabel8.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel8.setForeground(new java.awt.Color(255, 255, 255));
        jLabel8.setText("Ubicación:");
        jLabel8.setName("jLabel8"); // NOI18N
        getContentPane().add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 280, 60, -1));

        jLabel9.setForeground(new java.awt.Color(255, 255, 255));
        jLabel9.setText("Ciudad:");
        jLabel9.setName("jLabel9"); // NOI18N
        getContentPane().add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 330, -1, -1));

        jLabel10.setForeground(new java.awt.Color(255, 255, 255));
        jLabel10.setText("Pais:");
        jLabel10.setName("jLabel10"); // NOI18N
        getContentPane().add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 360, -1, -1));

        jLabel11.setForeground(new java.awt.Color(255, 255, 255));
        jLabel11.setText("Hora:");
        jLabel11.setName("jLabel11"); // NOI18N
        getContentPane().add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 130, -1, -1));

        jLabel12.setForeground(new java.awt.Color(255, 255, 255));
        jLabel12.setText("Minuto:");
        jLabel12.setName("jLabel12"); // NOI18N
        getContentPane().add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 160, -1, -1));

        jLabel13.setForeground(new java.awt.Color(255, 255, 255));
        jLabel13.setText("Segundos:");
        jLabel13.setName("jLabel13"); // NOI18N
        getContentPane().add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 200, -1, -1));

        jLabel17.setForeground(new java.awt.Color(255, 255, 255));
        jLabel17.setText("Horario De Entrada");
        jLabel17.setName("jLabel17"); // NOI18N
        getContentPane().add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 90, -1, -1));

        jLabel18.setForeground(new java.awt.Color(255, 255, 255));
        jLabel18.setText("Horario de Salida");
        jLabel18.setName("jLabel18"); // NOI18N
        getContentPane().add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 260, -1, -1));

        jBAceptar.setText("Aceptar");
        jBAceptar.setName("jBAceptar"); // NOI18N
        jBAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBAceptarActionPerformed(evt);
            }
        });
        getContentPane().add(jBAceptar, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 394, -1, -1));

        jLabel19.setForeground(new java.awt.Color(255, 255, 255));
        jLabel19.setText("Dirección:");
        jLabel19.setName("jLabel19"); // NOI18N
        getContentPane().add(jLabel19, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 300, -1, -1));

        jLabel14.setForeground(new java.awt.Color(255, 255, 255));
        jLabel14.setText("Hora:");
        jLabel14.setName("jLabel14"); // NOI18N
        getContentPane().add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 300, -1, -1));

        jLabel15.setForeground(new java.awt.Color(255, 255, 255));
        jLabel15.setText("Minuto:");
        jLabel15.setName("jLabel15"); // NOI18N
        getContentPane().add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 330, -1, -1));

        jLabel16.setForeground(new java.awt.Color(255, 255, 255));
        jLabel16.setText("Segundos:");
        jLabel16.setName("jLabel16"); // NOI18N
        getContentPane().add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 370, -1, -1));

        jCSucursal.setName("jCSucursal"); // NOI18N
        jCSucursal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCSucursalActionPerformed(evt);
            }
        });
        getContentPane().add(jCSucursal, new org.netbeans.lib.awtextra.AbsoluteConstraints(102, 57, 349, -1));

        jLabel20.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel20.setForeground(new java.awt.Color(255, 255, 255));
        jLabel20.setText("Sucursal:");
        jLabel20.setName("jLabel20"); // NOI18N
        getContentPane().add(jLabel20, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 60, -1, -1));

        jTMinS.setName("jTMinS"); // NOI18N
        getContentPane().add(jTMinS, new org.netbeans.lib.awtextra.AbsoluteConstraints(351, 328, 100, -1));

        jTSegS.setName("jTSegS"); // NOI18N
        getContentPane().add(jTSegS, new org.netbeans.lib.awtextra.AbsoluteConstraints(351, 368, 100, -1));

        jHoraS.setName("jHoraS"); // NOI18N
        getContentPane().add(jHoraS, new org.netbeans.lib.awtextra.AbsoluteConstraints(351, 292, 100, -1));

        jPanel1.setBackground(new java.awt.Color(51, 51, 51));
        jPanel1.setName("jPanel1"); // NOI18N
        jPanel1.setLayout(null);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("Mostrar Sucursales");
        jLabel1.setName("jLabel1"); // NOI18N
        jPanel1.add(jLabel1);
        jLabel1.setBounds(190, 20, 131, 17);

        getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 480, 440));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jCSucursalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCSucursalActionPerformed
FuncionesGUI.cargarListaCineEnCombo(jCTelefonos,jCLasSalas,jCSucursal.getSelectedIndex()-1, jTID, jTGerente, jTDireccion, jTCiudad, jTPais);


        // TODO add your handling code here:
    }//GEN-LAST:event_jCSucursalActionPerformed

    private void jBAceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAceptarActionPerformed
        FuncionesGUI.habilitarVentana(this.ventanaPadre, true, true);
        this.dispose();
        // TODO add your handling code here:
    }//GEN-LAST:event_jBAceptarActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        // TODO add your handling code here:
        FuncionesGUI.habilitarVentana(this.ventanaPadre, true, true);
        this.dispose();
    }//GEN-LAST:event_formWindowClosing

    /**
    * @param args the command line arguments
    */

     public void setVentanaPadre(JFrame ventanaPadre)
    {
        this.ventanaPadre = ventanaPadre;
    }

    public JFrame getVentanaPadre() {
        return ventanaPadre;
    }
    private void initMyOwnComponents()
    {

        FuncionesGUI.inicializarCombo (jCSucursal, "Seleccione un Cine");
        FuncionesGUI.cargarListaCinesEnCombo(jCSucursal, false);
    }




    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MostrarSucursales().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBAceptar;
    private javax.swing.JComboBox jCEmpleados;
    private javax.swing.JComboBox jCLasSalas;
    private javax.swing.JComboBox jCSucursal;
    private javax.swing.JComboBox jCTelefonos;
    private javax.swing.JTextField jHoraE;
    private javax.swing.JTextField jHoraS;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JTextField jTCiudad;
    private javax.swing.JTextField jTDireccion;
    private javax.swing.JTextField jTGerente;
    private javax.swing.JTextField jTID;
    private javax.swing.JTextField jTMinE;
    private javax.swing.JTextField jTMinS;
    private javax.swing.JTextField jTPais;
    private javax.swing.JTextField jTSegE;
    private javax.swing.JTextField jTSegS;
    private javax.swing.JTextField jTextField2;
    // End of variables declaration//GEN-END:variables

}
